import {Component} from "react";
import {View, Text, Image} from "@tarojs/components";
import {AtButton} from 'taro-ui'
import {AtAvatar} from 'taro-ui'
import "./index.less";
import {abstractSvc} from "../../serverConfig/serverManager";
import Zoom from 'react-reveal/Zoom'
import Slide from 'react-reveal/Slide'
import Fade from 'react-reveal/Fade'
import Flip from 'react-reveal/Flip';
import Jello from 'react-reveal/Jello';
import Flash from 'react-reveal/Flash';
import Swing from 'react-reveal/Swing';
import Roll from 'react-reveal/Roll';
import LightSpeed from 'react-reveal/LightSpeed';

export default class CardComponent extends Component {
  constructor(props) {
    super(props);
  }

  componentDidMount() {
  }

  componentWillUnmount() {
  }

  componentDidShow() {
  }

  componentDidHide() {
  }

  state = {
    card: []
  }


  render() {
    let card = <></>
    if(this.props.imgSrc!=='')
      card = <Image className={'cardImg'}
                    src={this.props.imgSrc}/>
    return (
      <View className={'card'}>
        <View className={'innerBox'}>
          {card}
          <View>
            <ul>
              {this.props.textList.map((item,index) => {
                if(index<10) return <li key={index} className={'lineText'}>{item}</li>
                else if(index+1===this.props.textList.length) return <li key={index} className={'lineText'}>...</li>
              })}
            </ul>
          </View>
          <View className={'cardText'}>{this.props.source}</View>
        </View>
      </View>
    )
      ;
  }

}
